<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <link rel="stylesheet" type="text/css" href="./source/modules/ihotel/template/css/main.css" media="all"/>
    <link rel="stylesheet" type="text/css" href="./source/modules/ihotel/template/css/dialog.css" media="all"/>
    <script type="text/javascript" src="./source/modules/ihotel/template/js/jquery_min.js"></script>
    <script type="text/javascript" src="./source/modules/ihotel/template/js/main.js"></script>
    <script type="text/javascript" src="./source/modules/ihotel/template/js/dialog_min.js"></script>
    <script type="text/javascript" src="./source/modules/ihotel/template/js/iscroll.js"></script>
    <title>{$title}</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
    <meta name="Keywords" content=""/>
    <meta name="Description" content=""/>
    <!-- Mobile Devices Support @begin -->
    <meta content="application/xhtml+xml;charset=UTF-8" http-equiv="Content-Type">
    <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
    <meta content="no-cache" http-equiv="pragma">
    <meta content="0" http-equiv="expires">
    <meta content="telephone=no, address=no" name="format-detection">
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <!-- apple devices fullscreen -->
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
    <!-- Mobile Devices Support @end -->
    <style>
        img {
            max-width: 100% !important;
        }
    </style>
</head>
<body onselectstart="return true;" ondragstart="return false;">

<script>


    function deleteOrder() {
        confirm("删除订单", " 你确定要删除该订单吗？", function () {

        }, function () {

            //生成支付地址url
            $.ajax({
                url: "/Webhotel/DeleteBook?pid=1071&wechatid=osXr8jiIm4HVEnuN28FShCPvg2k4&oid=5502",
                type: "post",
                dataType: 'json',
                success: function (data) {
                    //提示错误信息
                    if (data.errno == 1) {
                        alert(data.msg, 1500)
                    } else {
                        url = "/Webhotel/index?pid=1071&wechatid=osXr8jiIm4HVEnuN28FShCPvg2k4&hid=15"
                        setTimeout("location.href='" + url + "'", 20);
                    }
                },
                error: function () {

                }
            });

        });
    }

    //已经付款的提示

    // function cancelOrder(){
    // 	confirm("取消订单", " 你确定要取消该订单吗？<p style='font-size:12px;color:#7e7e7e;line-height:20px;'>取消订单后，请拨打电话联系商家退款！</p>", function(){
    // 		alert('取消');
    // 	}, function(){
    // 		alert('确定');
    // 	} );
    // }


    function cancelOrder(pay_status) {


        if (pay_status == 1) {
            confirm("取消订单", " 你确定要取消该订单吗？<p style='font-size:12px;color:#7e7e7e;line-height:20px;'>取消订单后，请拨打电话联系商家退款！</p>", function () {

            }, function () {

                //生成支付地址url
                $.ajax({
                    url: "/Webhotel/CancelOrder?pid=1071&wechatid=osXr8jiIm4HVEnuN28FShCPvg2k4&oid=5502",
                    type: "post",
                    dataType: 'json',
                    success: function (data) {
                        //提示错误信息
                        if (data.errno == 1) {
                            alert(data.msg, 1500)
                        } else {
                            setTimeout("location.reload()", 20);
                        }
                    },
                    error: function () {

                    }
                });

            });
        } else {
            confirm("取消订单", " 你确定要取消该订单吗？", function () {

            }, function () {

                //生成支付地址url
                $.ajax({
                    url: "/Webhotel/CancelOrder?pid=1071&wechatid=osXr8jiIm4HVEnuN28FShCPvg2k4&oid=5502",
                    type: "post",
                    dataType: 'json',
                    success: function (data) {
                        //提示错误信息
                        if (data.errno == 1) {
                            alert(data.msg, 1500)
                        } else {
                            setTimeout("location.reload()", 20);
                        }
                    },
                    error: function () {
                    }
                });

            });
        }
    }

    function payOrder(thi, evt) {
        var pay_id = $(thi).val();
        //生成支付地址url
        $.ajax({
            url: "/Webhotel/PayUrl?pid=1071&wechatid=osXr8jiIm4HVEnuN28FShCPvg2k4&oid=5502",
            type: "post",
            dataType: 'json',
            data: {pay_id: pay_id},
            success: function (data) {
                //提示错误信息
                if (data.errno == 1) {
                    alert(data.msg, 1500)
                } else {
                    setTimeout("location.href='" + data.url + "'", 20);
                }
            },
            error: function () {

            }
        });
    }
</script>
<div id="container" class="container hotel_order_detail">
    <header></header>
    <div class="body">
        <section class="section_detail section_detail_order">
            <header>
                <ul class="tbox">
                    <li>
                        <label class="pre">订单总额：<span class="price">￥1196</span></label>
                    </li>
                    <li class="align_right">
                        <span>处理中</span>
                    </li>
                </ul>
            </header>
            <article>
                <table>
                    <tr>
                        <td>订单:</td>
                        <td>040123001091919</td>
                    </tr>
                    <tr>
                        <td>订单类型:</td>
                        <td><span data-pay-state="20">外卖</span></td>
                    </tr>
                    <tr>
                        <td>预 订 人:</td>
                        <td>陈先生</td>
                    </tr>
                    <tr>
                        <td>预订电话:</td>
                        <td>13623009596</td>
                    </tr>
                    <tr>
                        <td>地址:</td>
                        <td>汕头大学101号室</td>
                    </tr>
                    <tr>
                        <td>离店日期：</td>
                        <td>2014-04-27</td>
                    </tr>
                    <tr>
                        <td>入住房型：</td>
                        <td>高级房（一）</td>
                    </tr>
                    <tr>
                        <td>预订间数：</td>
                        <td>1间</td>
                    </tr>
                    <tr>
                        <td>特殊需求：</td>
                        <td>无</td>
                    </tr>
                </table>
            </article>
        </section>
        <section class="section_detail section_detail_addr">
            <ul class="list_detail">
                <li>
                    <a href="/Webhotel/index?pid=1071&wechatid=osXr8jiIm4HVEnuN28FShCPvg2k4&hid=15"
                       class="tbox arrow hotel_name">
                        <div>
                            <label>蓝天宾馆</label>
                        </div>
                    </a>
                </li>
                <li>
                    <a href="http://api.map.baidu.com/marker?location=31.341748,121.501058&title=上海宝山区逸仙路2816号华滋奔腾大厦A栋15楼&name=上海宝山区逸仙路2816号华滋奔腾大厦A栋15楼&content=上海宝山区逸仙路2816号华滋奔腾大厦A栋15楼&output=html&src=weiba|weiweb" class="tbox arrow hotel_addr">
                        <div>
                            <span class="icons icons_addr">&nbsp;</span>
                        </div>
                        <div>
                            <label>上海宝山区逸仙路2816号华滋奔腾大厦A栋15楼</label>
                        </div>
                    </a>
                </li>
                <li>
                    <a href="tel:02160561178" class="tbox arrow hotel_tel">
                        <div>
                            <span class="icons icons_tel">&nbsp;</span>
                        </div>
                        <div>
                            <label>02160561178</label>
                        </div>
                    </a>
                </li>
            </ul>
        </section>
    </div>
    <footer>
        <section class="nav_footer">
            <ul class="box">
                <li>
                    <a href="javascript:;"
                       onclick="document.getElementById('pop_window_room_num_select').classList.add('on');">
                        <label class="pre">立即支付</label>
                    </a>
                </li>
                <li>
                    <a href="javascript:cancelOrder(0);">
                        <label class="pre">取消订单</label>
                    </a>
                </li>
            </ul>
            <!--<ul class="box">-->
                <!--<li style="display:none;">&nbsp;</li>-->
                <!--<li>-->
                    <!--<a href="javascript:deleteOrder();">-->
                        <!--<label class="pre" style="color:#fe8b10;">删除订单</label>-->
                    <!--</a>-->
                <!--</li>-->
            <!--</ul>-->
        </section>
    </footer>
</div>

<div class="pop_window">
    <div id="pop_window_room_num_select" class="pop_window_1 pop_window_pay_type_select">
        <header>
            <h5>选择支付方式</h5>
        </header>
        <div>
            <dl>
                <dd>
                    <label>
                        <input type="radio" name="pay_id" class="radio fr" onclick="payOrder(this,event);" value="168"
                               checked="checked">支付宝支付 </label>
                </dd>
                <dd>
                    <label>
                        <input type="radio" name="pay_id" class="radio fr" onclick="payOrder(this,event);" value="4049"
                               checked="checked">财付通 </label>
                </dd>

            </dl>
        </div>
    </div>
    <div class="cover" onclick="document.getElementById('pop_window_room_num_select').classList.remove('on');"></div>
</div>
<div mark="stat_code" style="width:0px; height:0px; display:none;">
</div>
</body>
</html>